package com.xm.apd.nettyserver;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.xm.apd.nettyserver.netty.Server;
import com.xm.apd.nettyserver.util.NetUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

    @BindView(R.id.btn_start)
    Button start;
    @BindView(R.id.tv)
    TextView tv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
        tv.setText(NetUtil.getLocalIP(this));
    }

    @OnClick({R.id.btn_start})
    public void OnClick(View view){
        switch (view.getId()){
            case R.id.btn_start:
                Server.start();
                break;
        }
    }
}
